/*******************************************************************************
  Application name: Voipaperi
  Filename: mainwindow.h
  Author: Juhapekka Piiroinen
  License: GNU/GPLv3
  Description:
      This is a quick-and-dirty application for layout analysis

  (C) 2010 Juhapekka Piiroinen
  http://code.google.com/p/quickanddirty
  juhapekka.piiroinen@gmail.com
*******************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDropEvent>
#include <QEvent>
#include <QPixmap>
#include <QMimeData>
#include <QFile>
#include <QUrl>
#include <QDebug>
#include <QDir>
#include <QFileDialog>
#include <QDesktopWidget>
#include <QDateTime>
#include <QDesktopServices>
#include <QTimer>
#include <QGraphicsScene>
#include <QGraphicsPixmapItem>
#include <QMessageBox>

#define IN qDebug() << QString("%0 >> %1:%2::%3").arg(QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss.zzz")).arg(__FILE__).arg(__LINE__).arg(__FUNCTION__).toAscii().data()
#define OUT qDebug() << QString("%0 << %1:%2::%3").arg(QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss.zzz")).arg(__FILE__).arg(__LINE__).arg(__FUNCTION__).toAscii().data()

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected slots:
    void takeScreenshot();
    void on_actionLoad_PNG_Layout_triggered();
    void on_actionHelp_triggered();
    void on_actionVoipaperi_mode_triggered();

protected:
    void changeEvent(QEvent *e);
    void dropEvent(QDropEvent *event);
    void dragEnterEvent(QDragEnterEvent *event);
    void dragMoveEvent(QDragMoveEvent *event);
    void dragLeaveEvent(QDragLeaveEvent *event);
    void keyReleaseEvent(QKeyEvent *event);
    void keyPressEvent(QKeyEvent *event);
    void paintEvent(QPaintEvent *event);
    void closeEvent(QCloseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void loadFromFile(QString filename);
    void showHelp();

private:
    Ui::MainWindow *ui;
    QPixmap pixmap;
    QPoint previousMouseLocation;
};

#endif // MAINWINDOW_H

